package plugin.eos.awake.flutter.awake1.network;


import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * Created by helin on 2016/10/10 15:49.
 */

public abstract class MySubscriber<T> implements Observer<T> {
	private String errorMsg;
	private String url;
	private boolean interceptMsg = true;

	public MySubscriber(String url) {
		this.url = url;
	}

	public MySubscriber(String url, boolean interceptMsg) {
		this.url = url;
		this.interceptMsg = interceptMsg;
	}

	public MySubscriber(String url, String errormsg) {
		this.url = url;
		errorMsg = errormsg;
	}

	public String getUrl() {
		return url;
	}

	@Override
	public void onSubscribe(Disposable d) {

	}

	@Override
	public void onComplete() {
	}


	@Override
	public void onNext(T t) {
		_onNext(t);
	}

	@Override
	public void onError(Throwable e) {
		_onError(e,"sss");
	}

	protected abstract void _onNext(T t);

	protected abstract void _onError(Throwable e, String message);
}
